Analog-To-Digital Converter Protection Circuit, Method for Controlling Analog-To-Digital Converter Protection Circuit, and Controller

ABSTRACT

An analog-to-digital converter protection circuit, a method for controlling an analog-to-digital converter protection circuit, and a controller are disclosed. The analog-to-digital converter protection circuit includes: an analog switch, an analog-to-digital converter, a controller, and a series circuit including at least two resistors connected in series. The controller is configured to: when the digital voltage is greater than or equal to a preset voltage threshold, output a control signal to the analog switch, to trigger the analog switch to control to a second sampling end from a first sampling end to serve as the conduction sampling end to conduct to the output end of the analog switch, where an analog voltage sampled by the second sampling end is less than an analog voltage sampled by the first sampling end; and when the digital voltage is less than the preset voltage threshold, output the digital voltage.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a National Stage of International Application No.PCT/CN2014/095500, filed on Dec. 30, 2014, which is hereby incorporatedby reference in its entirety.

TECHNICAL FIELD

The present invention relates to the field of electronic technologies,and specifically, to an analog-to-digital converter protection circuit,a method for controlling an analog-to-digital converter protectioncircuit, and a controller.

BACKGROUND

In an FITH (Fiber To The Home) system, quality of an access fiber linkis very important to user experience. A user usually obtains a magnitudeof a receive optical power of an ONU by using an RSSI (Received SignalStrength Indication) of the ONU, and further determines quality of anaccess fiber link.

At present, a circuit for detecting a magnitude of a receive opticalpower in an ONU, as shown in FIG. 1, includes an analog-to-digitalconverter and a sampling circuit. The sampling circuit includes a filtercapacitor C and a sampling resistor R that are connected in parallel.One end of the sampling resistor R is connected to an input end of theanalog-to-digital converter and is configured to be connected to anoutput end of a BOSA (Bi-Directional Optical Sub-Assembly), and theother end of the sampling resistor R is connected to a grounding end ofthe analog-to-digital converter and is configured to be grounded. Oneend of the filter capacitor C is configured to be connected to theoutput end of BOSA, and the other end of the filter capacitor C isconfigured to be grounded. A principle of the circuit shown in FIG. 1 isas follows: The BOSA converts a received optical signal into aphotocurrent and inputs the photocurrent to the sampling circuit to forman analog voltage. The analog-to-digital converter performsanalog-to-digital conversion on the analog voltage and outputs a digitalvoltage. In an actual application, the ONU performs sampling on fiveoptical signals with different optical powers by using the circuit shownin FIG. 1, to obtain five different digital voltages. Then, the ONUperforms curve fitting on the optical powers and the digital voltagescorresponding to the optical powers, to obtain a correspondence curvebetween the digital voltages and the optical powers. In this way, theONU can calculate a magnitude of an optical power of a received opticalsignal according to a digital voltage outputted by the analog-to-digitalconverter and the correspondence curve.

However, when an optical power of an optical signal received by the BOSAis excessively large, a photocurrent inputted to the sampling circuit isalso excessively large. Consequently, an analog voltage across the twoends of the sampling resistor exceeds a sampling voltage range of theanalog-to-digital converter, causing damage to the analog-to-digitalconverter.

SUMMARY

Embodiments of the present invention disclose an analog-to-digitalconverter protection circuit, a method for controlling ananalog-to-digital converter protection circuit, and a controller, sothat an analog-to-digital converter can sample an analog voltage withina sampling voltage range of the analog-to-digital converter.

A first aspect of the embodiments of the present invention discloses ananalog-to-digital converter protection circuit, including an analogswitch, an analog-to-digital converter, a controller, and a seriescircuit. The series circuit includes at least two resistors connected inseries. A head end of the series circuit is configured to be connectedto an output end of a bi-directional optical sub-assembly BOSA. A tailend of the series circuit is configured to be grounded. A ground-distantend of each resistor in the series circuit is connected to a differentsampling end of the analog switch. An output end of the analog switch isconnected to an input end of the analog-to-digital converter. An outputend of the analog-to-digital converter is connected to an input end ofthe controller. A first output end of the controller is connected to acontrol end of the analog switch. The series circuit is configured toconvert a photocurrent outputted by the BOSA into an analog voltage. Thedifferent sampling end is configured to sample the analog voltageoutputted by the series circuit. The analog switch is configured tooutput, to the analog-to-digital converter. An analog voltage sampled bya conduction sampling end of the analog switch. A first sampling endserves as the conduction sampling end to conduct to the output end ofthe analog switch. The analog-to-digital converter is configured to:perform analog-to-digital conversion on the analog voltage sampled bythe conduction sampling end to generate a digital voltage, and outputthe digital voltage to the controller. The controller is configured to:when the digital voltage is greater than or equal to a first presetvoltage threshold, output a first control signal to the analog switch,where the first control signal is used to trigger the analog switch tocontrol a second sampling end to serve as the conduction sampling end toconduct to the output end of the analog switch, and an analog voltagesampled by the second sampling end is less than an analog voltagesampled by the first sampling end. When the digital voltage is less thanthe first preset voltage threshold, control a second output end of thecontroller to output the digital voltage, where the first preset voltagethreshold falls within a sampling voltage range of the analog-to-digitalconverter.

In a first possible implementation manner of the first aspect of theembodiments of the present invention, that when the digital voltage isless than the first preset voltage threshold, the controller controls asecond output end of the controller to output the digital voltage isspecifically: when the digital voltage is less than the first presetvoltage threshold and the digital voltage is greater than a secondpreset voltage threshold, controlling the second output end of thecontroller to output the digital voltage, where the second presetvoltage threshold falls within the sampling voltage range; and thecontroller is further configured to: when the digital voltage is lessthan or equal to the second preset voltage threshold, output a secondcontrol signal to the analog switch, where the second control signal isused to trigger the analog switch to control a third sampling end toserve as the conduction sampling end to conduct to the output end of theanalog switch, and an analog voltage sampled by the third sampling endis greater than the analog voltage sampled by the first sampling end.

With reference to the first aspect of the embodiments of the presentinvention or the first possible implementation manner of the firstaspect of the embodiments of the present invention, in a second possibleimplementation manner of the first aspect of the embodiments of thepresent invention, when the analog switch controls and changes theconduction sampling end conducted to the output end of the analogswitch, a resistor quantity change between the conduction sampling endconducted to the output end of the analog switch and the tail end of theseries circuit is at least 1.

With reference to any one of the first aspect of the embodiments of thepresent invention or the foregoing possible implementation manners ofthe first aspect of the embodiments of the present invention, in a thirdpossible implementation manner of the first aspect of the embodiments ofthe present invention, an initial conduction sampling end conducted tothe output end of the analog switch is a sampling end connected to aground-distant end of a tail resistor of the series circuit; and aproduct of a resistance value of the tail resistor of the series circuitand a preset photocurrent threshold falls within the sampling voltagerange.

With reference to any one of the first aspect of the embodiments of thepresent invention or the foregoing possible implementation manners ofthe first aspect of the embodiments of the present invention, in afourth possible implementation manner of the first aspect of theembodiments of the present invention, a product of a total resistancevalue of all resistors in the series circuit and the preset photocurrentthreshold is greater than or equal to sampling precision of theanalog-to-digital converter.

With reference to any one of the first aspect of the embodiments of thepresent invention or the foregoing possible implementation manners ofthe first aspect of the embodiments of the present invention, in a fifthpossible implementation manner of the first aspect of the embodiments ofthe present invention, the controller is a bi-directional opticalsub-assembly drive chip.

With reference to any one of the first aspect of the embodiments of thepresent invention or the foregoing possible implementation manners ofthe first aspect of the embodiments of the present invention, in a sixthpossible implementation manner of the first aspect of the embodiments ofthe present invention, the analog switch includes any one of anintegrated analog switch component, a discrete component, or a relay.

A second aspect of the embodiments of the present invention discloses amethod for controlling an analog-to-digital converter protectioncircuit. The analog-to-digital converter protection circuit includes ananalog switch, an analog-to-digital converter, a controller, and aseries circuit. The series circuit includes at least two resistorsconnected in series. A head end of the series circuit is configured tobe connected to an output end of a BOSA. A tail end of the seriescircuit is configured to be grounded, a ground-distant end of eachresistor in the series circuit is connected to a different sampling endof the analog switch. An output end of the analog switch is connected toan input end of the analog-to-digital converter. An output end of theanalog-to-digital converter is connected to an input end of thecontroller. A first output end of the controller is connected to acontrol end of the analog switch. The method includes: receiving, by thecontroller, a digital voltage outputted by the analog-to-digitalconverter, where the digital voltage is a digital voltage obtained bythe analog-to-digital converter by performing analog-to-digitalconversion on an analog voltage sampled by a conduction sampling end ofthe analog switch, and a first sampling end serves as the conductionsampling end to conduct to the output end of the analog switch. Themethod also includes, when the digital voltage is greater than or equalto a first preset voltage threshold, outputting, by the controller, afirst control signal to the analog switch, where the first controlsignal is used to trigger the analog switch to control a second samplingend to serve as the conduction sampling end to conduct to the output endof the analog switch, an analog voltage sampled by the second samplingend is less than an analog voltage sampled by the first sampling end,and the first preset voltage threshold falls within a sampling voltagerange of the analog-to-digital converter. The method also includes, whenthe digital voltage is less than the first preset voltage threshold,controlling, by the controller, a second output end of the controller tooutput the digital voltage.

In a first possible implementation manner of the second aspect of theembodiments of the present invention, the when the digital voltage isless than the first preset voltage threshold, controlling, by thecontroller, a second output end of the controller to output the digitalvoltage includes: when the digital voltage is less than the first presetvoltage threshold and the digital voltage is greater than a secondpreset voltage threshold, controlling, by the controller, the secondoutput end of the controller to output the digital voltage, where thesecond preset voltage threshold falls within the sampling voltage range;and when the digital voltage is less than or equal to the second presetvoltage threshold, outputting, by the controller, a second controlsignal to the analog switch, where the second control signal is used totrigger the analog switch to control a third sampling end to serve asthe conduction sampling end to conduct to the output end of the analogswitch, and an analog voltage sampled by the third sampling end isgreater than the analog voltage sampled by the first sampling end.

With reference to the second aspect of the embodiments of the presentinvention or the first possible implementation manner of the secondaspect of the embodiments of the present invention, in a second possibleimplementation manner of the second aspect of the embodiments of thepresent invention, when the analog switch controls and changes theconduction sampling end conducted to the output end of the analogswitch, a resistor quantity change between the conduction sampling endconducted to the output end of the analog switch and the tail end of theseries circuit is at least 1.

With reference to any one of the second aspect of the embodiments of thepresent invention or the foregoing possible implementation manners ofthe second aspect of the embodiments of the present invention, in athird possible implementation manner of the second aspect of theembodiments of the present invention, an initial conduction sampling endconducted to the output end of the analog switch is a sampling endconnected to a ground-distant end of a tail resistor of the seriescircuit; and a product of a resistance value of the tail resistor of theseries circuit and a preset photocurrent threshold falls within thesampling voltage range.

With reference to any one of the second aspect of the embodiments of thepresent invention or the foregoing possible implementation manners ofthe second aspect of the embodiments of the present invention, in afourth possible implementation manner of the second aspect of theembodiments of the present invention, a product of a total resistancevalue of all resistors in the series circuit and the preset photocurrentthreshold is greater than or equal to sampling precision of theanalog-to-digital converter.

With reference to any one of the second aspect of the embodiments of thepresent invention or the foregoing possible implementation manners ofthe second aspect of the embodiments of the present invention, in afifth possible implementation manner of the second aspect of theembodiments of the present invention, the controller is a bi-directionaloptical sub-assembly drive chip.

With reference to any one of the second aspect of the embodiments of thepresent invention or the foregoing possible implementation manners ofthe second aspect of the embodiments of the present invention, in asixth possible implementation manner of the second aspect of theembodiments of the present invention, the analog switch includes any oneof an integrated analog switch component, a discrete component, or arelay.

A third aspect of the embodiments of the present invention discloses acontroller in an analog-to-digital converter protection circuit,including: a processor, a memory, an input port, a first output port,and a second output port. The analog-to-digital converter protectioncircuit includes an analog switch, an analog-to-digital converter, thecontroller, and a series circuit. The series circuit includes at leasttwo resistors connected in series. A head end of the series circuit isconfigured to be connected to an output end of a BOSA. A tail end of theseries circuit is configured to be grounded. A ground-distant end ofeach resistor in the series circuit is connected to a different samplingend of the analog switch. An output end of the analog switch isconnected to an input end of the analog-to-digital converter. An outputend of the analog-to-digital converter is connected to the input port,and the first output port is connected to a control end of the analogswitch. The input port is configured to receive a digital voltageoutputted by the analog-to-digital converter, where the digital voltageis a digital voltage obtained by the analog-to-digital converter byperforming analog-to-digital conversion on an analog voltage sampled bya conduction sampling end of the analog switch, and a first sampling endserves as the conduction sampling end to conduct to the output end ofthe analog switch. The memory stores a set of program code, and theprocessor is configured to invoke the program code stored in the memoryto perform the following operation: determining whether the digitalvoltage is greater than or equal to a first preset voltage threshold,where the first preset voltage threshold falls within a sampling voltagerange of the analog-to-digital converter. The first output port isconfigured to: when the digital voltage is greater than or equal to thefirst preset voltage threshold, output a first control signal to theanalog switch, where the first control signal is used to trigger theanalog switch to control a second sampling end to serve as theconduction sampling end to conduct to the output end of the analogswitch, and an analog voltage sampled by the second sampling end is lessthan an analog voltage sampled by the first sampling end. The secondoutput port is configured to: when the digital voltage is less than thefirst preset voltage threshold, output the digital voltage.

In a first possible implementation manner of the third aspect of theembodiments of the present invention, the processor is configured toinvoke the program code stored in the memory to further perform thefollowing operation: determining whether the digital voltage is greaterthan a second preset voltage threshold, where the second preset voltagethreshold falls within the sampling voltage range; the second outputport is specifically configured to: when the digital voltage is lessthan the first preset voltage threshold and the digital voltage isgreater than the second preset voltage threshold, output the digitalvoltage; and the first output port is further configured to: when thedigital voltage is less than or equal to the second preset voltagethreshold, output a second control signal to the analog switch, wherethe second control signal is used to trigger the analog switch tocontrol a third sampling end to serve as the conduction sampling end toconduct to the output end of the analog switch, and an analog voltagesampled by the third sampling end is greater than the analog voltagesampled by the first sampling end.

With reference to the third aspect of the embodiments of the presentinvention or the first possible implementation manner of the thirdaspect of the embodiments of the present invention, in a second possibleimplementation manner of the third aspect of the embodiments of thepresent invention, when the analog switch controls and changes theconduction sampling end conducted to the output end of the analogswitch, a resistor quantity change between the conduction sampling endconducted to the output end of the analog switch and the tail end of theseries circuit is at least 1.

With reference to any one of the third aspect of the embodiments of thepresent invention or the foregoing possible implementation manners ofthe third aspect of the embodiments of the present invention, in a thirdpossible implementation manner of the third aspect of the embodiments ofthe present invention, an initial conduction sampling end conducted tothe output end of the analog switch is a sampling end connected to aground-distant end of a tail resistor of the series circuit; and aproduct of a resistance value of the tail resistor of the series circuitand a preset photocurrent threshold falls within the sampling voltagerange.

With reference to any one of the third aspect of the embodiments of thepresent invention or the foregoing possible implementation manners ofthe third aspect of the embodiments of the present invention, in afourth possible implementation manner of the third aspect of theembodiments of the present invention, a product of a total resistancevalue of all resistors in the series circuit and the preset photocurrentthreshold is greater than or equal to sampling precision of theanalog-to-digital converter.

With reference to any one of the third aspect of the embodiments of thepresent invention or the foregoing possible implementation manners ofthe third aspect of the embodiments of the present invention, in a fifthpossible implementation manner of the third aspect of the embodiments ofthe present invention, the controller is a bi-directional opticalsub-assembly drive chip.

With reference to any one of the third aspect of the embodiments of thepresent invention or the foregoing possible implementation manners ofthe third aspect of the embodiments of the present invention, in a sixthpossible implementation manner of the third aspect of the embodiments ofthe present invention, the analog switch includes any one of anintegrated analog switch component, a discrete component, or a relay.

In the embodiments of the present invention, an analog-to-digitalconverter protection circuit includes an analog switch, ananalog-to-digital converter, a controller, and a series circuitincluding at least two resistors connected in series. The series circuitis configured to convert a photocurrent into an analog voltage. Theanalog switch is configured to output, to the analog-to-digitalconverter, an analog voltage sampled by a conduction sampling end of theanalog switch. The first sampling end serves as the conduction samplingend to conduct to an output end of the analog switch. Theanalog-to-digital converter is configured to: perform analog-to-digitalconversion on the analog voltage sampled by the conduction sampling endto generate a digital voltage, and output the digital voltage to thecontroller. The controller is configured to: when the digital voltage isgreater than or equal to a preset voltage threshold, output a controlsignal to the analog switch, where the control signal is used to triggerthe analog switch to control a second sampling end to serve as theconduction sampling end to conduct to the output end of the analogswitch, and an analog voltage sampled by the second sampling end is lessthan an analog voltage sampled by the first sampling end; and when thedigital voltage is less than the preset voltage threshold, output thedigital voltage. As can be seen, in the embodiments of the presentinvention, when the digital voltage outputted by the analog-to- digitalconverter is greater than or equal to the preset voltage threshold, thecontroller controls the second sampling end of the analog switch toserve as the conduction sampling end to conduct to the output end of theanalog switch, so as to decrease the analog voltage outputted by theanalog switch, so that the analog-to-digital converter can sample ananalog voltage within a sampling voltage range of the analog-to-digitalconverter. Therefore, a problem of damage to the analog-to-digitalconverter due to that the analog voltage exceeds the sampling voltagerange of the analog-to-digital converter is avoided.

BRIEF DESCRIPTION OF THE DRAWINGS

To describe the technical solutions in the embodiments of the presentinvention more clearly, the following briefly describes the accompanyingdrawings required for describing the embodiments. Apparently, theaccompanying drawings in the following description show merely someembodiments of the present invention, and a person of ordinary skill inthe art may still derive other drawings from these accompanying drawingswithout creative efforts.

FIG. 1 is a schematic structural diagram of a circuit for detecting amagnitude of a receive optical power according to an embodiment of thepresent invention;

FIG. 2 is a schematic structural diagram of an analog-to-digitalconverter protection circuit according to an embodiment of the presentinvention;

FIG. 3 is a schematic structural diagram showing that a controllercontrols an analog switch according to an embodiment of the presentinvention;

FIG. 4 is a schematic flowchart of a method for controlling ananalog-to-digital converter protection circuit according to anembodiment of the present invention; and

FIG. 5 is a schematic structural diagram of a controller of ananalog-to-digital converter protection circuit according to anembodiment of the present invention.

DETAILED DESCRIPTION OF ILLUSTRATIVE EMBODIMENTS

The following clearly and completely describes the technical solutionsin the embodiments of the present invention with reference to theaccompanying drawings in the embodiments of the present invention.Apparently, the described embodiments are merely some but not all of theembodiments of the present invention. All other embodiments obtained bya person of ordinary skill in the art based on the embodiments of thepresent invention without creative efforts shall fall within theprotection scope of the present invention.

Embodiments of the present invention disclose an analog-to-digitalconverter protection circuit, a method for controlling ananalog-to-digital converter protection circuit, and a controller, sothat an analog-to-digital converter can sample an analog voltage withina sampling voltage range of the analog-to-digital converter. Therefore,a problem of damage to the analog-to-digital converter due to that theanalog voltage exceeds the sampling voltage range of theanalog-to-digital converter is avoided.

Referring to FIG. 2, FIG. 2 is a schematic structural diagram of ananalog-to-digital converter protection circuit according to anembodiment of the present invention. As shown in FIG. 2, theanalog-to-digital converter protection circuit includes an analogswitch, an analog-to-digital converter, a controller, and a seriescircuit. The series circuit includes at least two resistors connected inseries, for example, R1 to RN shown in FIG. 2, where N is an integergreater than or equal to 2.

A head end of the series circuit is configured to be connected to anoutput end of a bi-directional optical sub-assembly BOSA. A tail end ofthe series circuit is configured to be grounded. A ground-distant end ofeach resistor in the series circuit is connected to a different samplingend of the analog switch. An output end of the analog switch isconnected to an input end of the analog-to-digital converter. An outputend of the analog-to-digital converter is connected to an input end ofthe controller. A first output end of the controller is connected to acontrol end of the analog switch.

The series circuit is configured to convert a photocurrent outputted bythe BOSA into an analog voltage. The different sampling end isconfigured to sample the analog voltage outputted by the series circuit.The analog switch is configured to output, to the analog-to-digitalconverter, an analog voltage sampled by a conduction sampling end of theanalog switch, and a first sampling end serves as the conductionsampling end to conduct to the output end of the analog switch.

The analog-to-digital converter is configured to: performanalog-to-digital conversion on the analog voltage sampled by theconduction sampling end to generate a digital voltage, and output thedigital voltage to the controller.

The controller is configured to: when the digital voltage is greaterthan or equal to a first preset voltage threshold, output a firstcontrol signal to the analog switch, where the first control signal isused to trigger the analog switch to control a second sampling end toserve as the conduction sampling end to conduct to the output end of theanalog switch, and an analog voltage sampled by the second sampling endis less than an analog voltage sampled by the first sampling end; andwhen the digital voltage is less than the first preset voltagethreshold, control a second output end of the controller to output thedigital voltage, where the first preset voltage threshold falls within asampling voltage range of the analog-to-digital converter.

In this embodiment of the present invention, the analog switch iscontrolled, according to a relationship between the digital voltageobtained by the controller and the first preset voltage threshold storedin the controller, to switch the conduction sampling end conducted tothe output end of analog switch, so that the analog-to-digital convertercan sample an analog voltage within a sampling voltage range of theanalog-to-digital converter. Therefore, a problem of damage to theanalog-to-digital converter due to that the analog voltage exceeds thesampling voltage range of the analog-to-digital converter is avoided.

In an optional implementation manner, that when the digital voltage isless than the first preset voltage threshold, the controller controls asecond output end of the controller to output the digital voltage isspecifically: when the digital voltage is less than the first presetvoltage threshold and the digital voltage is greater than a secondpreset voltage threshold, controlling the second output end of thecontroller to output the digital voltage, where the second presetvoltage threshold falls within the sampling voltage range.

The controller is further configured to: when the digital voltage isless than or equal to the second preset voltage threshold, output asecond control signal to the analog switch, where the second controlsignal is used to trigger the analog switch to control a third samplingend to serve as the conduction sampling end to conduct to the output endof the analog switch, and an analog voltage sampled by the thirdsampling end is greater than the analog voltage sampled by the firstsampling end.

As can be seen, when the digital voltage is less than the first presetvoltage threshold and is greater than the second preset voltagethreshold, the second output end of the controller is controlled tooutput the digital voltage. When the digital voltage received by thecontroller is less than or equal to the second preset voltage threshold,the controller outputs a control signal to the analog switch, to triggerthe analog switch to control and change the conduction sampling endconducted to the output end of the analog switch. The digital voltageoutputted by the analog-to-digital converter (that is the digitalvoltage received by the controller) is increased by changing theconduction sampling end conducted to the output end of the analogswitch. This not only ensures that the analog-to-digital converter cansample an analog voltage within a sampling voltage range of theanalog-to-digital converter, but also ensures sampling precision of theanalog-to-digital converter, so that the digital voltage outputted bythe controller falls within an effective scale.

It should be noted that the first preset voltage threshold and thesecond preset voltage threshold are preset voltage thresholds, which maybe calculated by the controller according to a preset calculation ruleand the sampling voltage range of the analog-to-digital converter, ormay be set by a user according to the user's requirements and thesampling voltage range of the analog-to-digital converter. This is notlimited in this embodiment of the present invention.

In an optional implementation manner, when the analog switch controlsand changes the conduction sampling end conducted to the output end ofthe analog switch, a resistor quantity change between the conductionsampling end conducted to the output end of the analog switch and thetail end of the series circuit is at least 1. That is, when theconduction sampling end conducted to the output end of the analog switchchanges from the first sampling end to the second sampling end, adifference between a resistor quantity between the first sampling endand the tail end of the series circuit and a resistor quantity betweenthe second sampling end and the tail end of the series circuit is aninteger greater than or equal to 1; when the conduction sampling endconducted to the output end of the analog switch changes from the firstsampling end to the third sampling end, a difference between a resistorquantity between the third sampling end and the tail end of the seriescircuit and the resistor quantity between the first sampling end and thetail end of the series circuit is an integer greater than or equal to 1.This provides a basis for generating the control signal to thecontroller.

In this embodiment of the present invention, an initial conductionsampling end conducted to the output end of the analog switch is asampling end connected to a ground- distant end of a tail resistor ofthe series circuit. That is, after the analog-to-digital converterprotection circuit shown in FIG. 2 finishes the sampling work or beforethe analog-to-digital converter protection circuit starts sampling, thecontroller outputs the control signal to the analog switch, to triggerthe analog switch to switch the conduction sampling end conducted to theoutput end of the analog switch to the initial conduction sampling end.In this way, when the analog-to-digital converter protection circuitshown in FIG. 2 starts sampling, a problem of damage to theanalog-to-digital converter due to that the analog voltage received bythe analog- to-digital converter exceeds the sampling voltage range ofthe analog-to-digital converter can be avoided.

Optionally, a product of a total resistance value of all resistors inthe series circuit and a preset photocurrent threshold is greater thanor equal to sampling precision of the analog- to-digital converter, aproduct of a resistance value of the tail resistor of the series circuitand the preset photocurrent threshold falls within the sampling voltagerange, and the preset photocurrent threshold is a minimum value of thephotocurrent outputted by the BOSA. This not only ensures the samplingprecision of the analog-to-digital converter, but also ensures that theanalog-to-digital converter can sample an analog voltage within asampling voltage range of the analog-to-digital converter.

In this embodiment of the present invention, the sampling precision ofthe analog-to-digital converter is equal to a ratio of a maximumsampling voltage (that is, a sampling voltage scale) of theanalog-to-digital converter to 2 raised to the power of M, where M is aquantity of bits of the analog-to-digital converter. In this way, theanalog-to-digital converter can output a precise digital voltage. Forexample, for a 10-bit analog-to-digital converter having a samplingvoltage scale of 2 V, the sampling precision is equal to 2/210 V.

In this embodiment of the present invention, when the digital voltage isgreater than the second preset voltage threshold and is less than thefirst preset voltage threshold, the controller does not output anycontrol signal to the analog switch. That is, the analog switchmaintains the conduction between the conduction sampling end and theoutput end of the analog signal. In this case, the controller controlsthe second output end of the controller to output the digital voltagethat is greater than the second preset voltage threshold and less thanthe first preset voltage threshold.

Optionally, the controller may be a bi-directional optical sub-assemblydrive chip.

In this embodiment of the present invention, the controller may be abi-directional optical sub-assembly drive chip in a current ONU. In thisway, hardware costs of the analog-to-digital converter protectioncircuit can be reduced.

Optionally, the analog switch may include, but is not limited to, anyone of an integrated analog switch component, a discrete component, or arelay.

As shown in FIG. 3, how the controller selects the conduction samplingend is described by using an example. Assuming that there are threeresistors in the foregoing series circuit, a schematic structuraldiagram showing that the controller controls the analog switch may beshown in FIG. 3. FIG. 3 is a schematic structural diagram showing thatthe controller controls the analog switch according to an embodiment ofthe present invention. In FIG. 3, the three resistors in the seriescircuit are respectively R1, R2, and R3. The analog switch has threesampling ends. The three sampling ends are respectively sampling end 1,sampling end 2, and sampling end 3. A ground-distant end of R1 isconnected to sampling end 1, a ground-distant end of R2 is connected tosampling end 2, and a ground-distant end of R3 is connected to samplingend 3. In FIG. 3, sampling end 1 serves as an initial conductionsampling end to conduct to the output end of the analog switch. Asampling voltage range of the analog-to-digital converter is o V to 2 V(that is, a sampling voltage scale of the analog-to-digital converter is2 V). The first preset voltage threshold is ¾ of the sampling voltagescale of the analog-to-digital converter, that is, 1.50 V. The secondpreset voltage threshold is ¼ of the sampling voltage scale of theanalog-to-digital converter, that is, 0.50 V. The photocurrent has avalue range of 0.05 mA to 1 mA. The preset photocurrent threshold is aminimum value of the photocurrent, that is, 0.05 mA. Resistance valuesof R1, R2, and R3 are respectively 1 K, 1.8 K, and 5 K. (1+1.8+5)*0.05is greater than 2/2¹⁰, and 1*0.05 falls within the sampling voltagerange of o V to 2 V of the analog-to-digital converter.

When the photocurrent received by the series circuit is greater than orequal to 50 μA and is less than or equal to 178 μA, an analog voltagesampled by sampling end 1 is greater than or equal to 0.05 V and is lessthan or equal to 0.18 V. After performing analog-to-digital conversionon the analog voltage, the analog-to-digital converter outputs, to thecontroller, a digital voltage that is greater than or equal to 0.05 Vand less than or equal to 0.18 V. Because 0.18 V is less than the secondpreset voltage threshold of 0.5 V, the controller outputs a controlsignal to the analog switch, to trigger the analog switch to controlsampling end 2 to serve as the conduction sampling end to conduct to theoutput end of the analog switch, and sampling end 1 is not conducted tothe output end of the analog switch. In this case, for a photocurrentgreater than or equal to 50 μA and less than or equal to 178 μA, theanalog-to-digital converter outputs, to the controller, a digitalvoltage greater than or equal to 0.14 V and less than or equal to 0.50V. Because 0.50 V is equal to the second preset voltage threshold of 0.5V, the controller outputs a control signal to the analog switch, totrigger the analog switch to control sampling end 3 to serve as theconduction sampling end to conduct to the output end of the analogswitch, and sampling end 2 is not conducted to the output end of theanalog switch.

Similarly, when the photocurrent received by the series circuit isgreater than 178 μA and is less than or equal to 192 μA, the controllerdoes not output any control signal to the analog switch, that is, theanalog switch maintains the conduction between sampling end 3 and theoutput end of the analog switch. When the photocurrent received by theseries circuit is greater than 192 μA and is less than or equal to 256μA, because sampling end 3 is conducted to the output end of the analogswitch and the analog voltage received by the controller is greater than1.50 V, the controller outputs a control signal to the analog switch, totrigger the analog switch to control sampling end 2 to serve as theconduction sampling end to conduct to the output end of the analogswitch. When the photocurrent received by the series circuit is greaterthan 256 μA and is less than or equal to 536 μA, the controller does notoutput any control signal to the analog switch, that is, the analogswitch maintains the conduction between sampling end 2 and the outputend of the analog switch. When the photocurrent received by the seriescircuit is greater than 536 μA and is less than or equal to 714 μA, thecontroller outputs a control signal to the analog switch, to trigger theanalog switch to control sampling end 1 to serve as the conductionsampling end to conduct to the output end of the analog switch. When thephotocurrent received by the series circuit is greater than 714 μA andis less than or equal to 1000 μA, the controller does not output anycontrol signal to the analog switch, that is, the analog switchmaintains the conduction between sampling end 1 and the output end ofthe analog switch.

Based on the above, in the schematic structural diagram showing that thecontroller controls the analog switch in FIG. 3, when the photocurrentreceived by the series circuit is greater than or equal to 50 μA and isless than or equal to 192 μA, sampling end 3 of the analog switch servesas the conduction sampling end to conduct to the output end of theanalog switch. When the photocurrent received by the series circuit isgreater than 192 μA and is less than or equal to 536 μA, sampling end 2of the analog switch serves as the conduction sampling end to conduct tothe output end of the analog switch. When the photocurrent received bythe series circuit is greater than 536 μA and is less than or equal to1000 μA, sampling end 1 of the analog switch serves as the conductionsampling end to conduct to the output end of the analog switch. Thisensures that the analog-to-digital converter can sample an analogvoltage within a sampling voltage range of o V to 2 V of theanalog-to-digital converter when the received photocurrent falls withina range of 0.05 mA to 1 mA, ensures sampling precision of theanalog-to-digital converter, and avoids a problem of damage to theanalog-to-digital converter due to that the analog voltage exceeds thesampling voltage range of the analog-to-digital converter.

Referring to FIG. 4, FIG. 4 is a schematic flowchart of a method forcontrolling an analog-to-digital converter protection circuit accordingto an embodiment of the present invention. The method shown in FIG. 4 isapplicable to the analog-to-digital converter protection circuit shownin FIG. 2, and is executed by the controller in the analog-to-digitalconverter protection circuit shown in FIG. 2. As shown in FIG. 4, themethod for controlling an analog-to-digital converter protection circuitmay include the following steps.

S401 :A controller receives a digital voltage outputted by ananalog-to-digital converter.

In this embodiment of the present invention, the digital voltageoutputted by the analog-to-digital converter is a digital voltageobtained by the analog-to-digital converter by performinganalog-to-digital conversion on an analog voltage sampled by aconduction sampling end of an analog switch, and a first sampling endserves as the conduction sampling end to conduct to an output end of theanalog switch.

S402: Determine whether the digital voltage is greater than or equal toa first preset voltage threshold.

In this embodiment of the present invention, when a result of thedetermining in step S402 is yes, the controller performs step S403; whenthe result of determining in step S402 is no, the controller performsstep S404.

S403: The controller outputs a first control signal to an analog switch.

In this embodiment of the present invention, the first preset voltagethreshold falls within a sampling voltage range of the analog-to-digitalconverter. The controller outputs the first control signal to the analogswitch, to trigger the analog switch to switch the conduction samplingend conducted to the output end of the analog switch from the firstsampling end to a second sampling end. An analog voltage sampled by thesecond sampling end is less than an analog voltage sampled by the firstsampling end. A quantity of conduction sampling ends conducted to theoutput end of the analog switch is one, that is, only one sampling endin all sampling ends of the analog switch is conducted to the output endof the analog switch.

S404: The controller controls a second output end of the controller tooutput the digital voltage.

In this embodiment of the present invention, when the digital voltage isless than the first preset voltage threshold, the controller controlsthe second output end of the controller to output the digital voltage.

In this embodiment of the present invention, the analog switch iscontrolled, according to a relationship between the digital voltageobtained by the controller and the first preset voltage threshold storedin the controller, to switch the conduction sampling end conducted tothe output end of analog switch, so that the analog-to-digital convertercan sample an analog voltage within a sampling voltage range of theanalog-to-digital converter. Therefore, a problem of damage to theanalog-to-digital converter due to that the analog voltage exceeds thesampling voltage range of the analog-to-digital converter is avoided.

In an optional implementation manner, when the digital voltage is lessthan the first preset voltage threshold, before step S404, the methodfor controlling an analog-to-digital converter protection circuit mayfurther include the following step: determining, by the controller,whether the digital voltage is greater than a second preset voltagethreshold.

That the controller controls a second output end of the controller tooutput the digital voltage may be specifically: when the digital voltageis less than the first preset voltage threshold and the digital voltageis greater than the second preset voltage threshold, controlling, by thecontroller, the second output end of the controller to output thedigital voltage, where the second preset voltage threshold falls withinthe sampling voltage range.

In this embodiment of the present invention, the method for controllingan analog-to-digital converter protection circuit may further includethe following step: when the digital voltage is less than or equal tothe second preset voltage threshold, outputting, by the controller, asecond control signal to the analog switch, where the second controlsignal is used to trigger the analog switch to switch the conductionsampling end conducted to the output end of the analog switch from thefirst sampling end to a third sampling end, and an analog voltagesampled by the third sampling end is greater than the analog voltagesampled by the first sampling end.

As can be seen, when the digital voltage is less than the first presetvoltage threshold and is greater than the second preset voltagethreshold, the second output end of the controller is controlled tooutput the digital voltage. When the digital voltage received by thecontroller is less than or equal to the second preset voltage threshold,the controller outputs a control signal to the analog switch, to triggerthe analog switch to control and change the conduction sampling endconducted to the output end of the analog switch. The digital voltageoutputted by the analog-to-digital converter (that is the digitalvoltage received by the controller) is increased by changing theconduction sampling end conducted to the output end of the analogswitch. This not only ensures that the analog-to-digital converter cansample an analog voltage within a sampling voltage range of theanalog-to-digital converter, but also ensures sampling precision of theanalog-to-digital converter, so that the digital voltage outputted bythe controller falls within an effective scale.

It should be noted that the first preset voltage threshold and thesecond preset voltage threshold are preset voltage thresholds, which maybe calculated by the controller according to a preset calculation ruleand the sampling voltage range of the analog-to-digital converter, ormay be set by a user according to the user's requirements and thesampling voltage range of the analog-to-digital converter. This is notlimited in this embodiment of the present invention.

In an optional implementation manner, when the analog switch controlsand changes the conduction sampling end conducted to the output end ofthe analog switch, a resistor quantity change between the conductionsampling end conducted to the output end of the analog switch and a tailend of a series circuit is at least 1. That is, when the conductionsampling end conducted to the output end of the analog switch changesfrom the first sampling end to the second sampling end, a differencebetween a resistor quantity between the first sampling end and the tailend of the series circuit and a resistor quantity between the secondsampling end and the tail end of the series circuit is an integergreater than or equal to 1; when the conduction sampling end conductedto the output end of the analog switch changes from the first samplingend into the third sampling end, a difference between a resistorquantity between the third sampling end and the tail end of the seriescircuit and the resistor quantity between the first sampling end and thetail end of the series circuit is an integer greater than or equal to 1.This provides a basis for generating the control signal to thecontroller.

In this embodiment of the present invention, an initial conductionsampling end conducted to the output end of the analog switch is asampling end connected to a ground-distant end of a tail resistor of theseries circuit. That is, after the analog-to-digital converterprotection circuit shown in FIG. 2 finishes the sampling work or after apreset working period, the controller outputs a control signal to theanalog switch, to trigger the analog switch to switch the conductionsampling end conducted to the output end of the analog switch to theinitial conduction sampling end. In this way, when the analog-to-digitalconverter protection circuit shown in FIG. 2 starts working, a problemof damage to the analog-to-digital converter due to that the analogvoltage received by the analog-to-digital converter exceeds the samplingvoltage range of the analog-to-digital converter can be avoided.

Optionally, a product of a total resistance value of all resistors inthe series circuit and a preset photocurrent threshold is greater thanor equal to sampling precision of the analog- to-digital converter, aproduct of a resistance value of the tail resistor of the series circuitand the preset photocurrent threshold falls within the sampling voltagerange, and the preset photocurrent threshold is a minimum value of aphotocurrent outputted by a BOSA. This not only ensures the samplingprecision of the analog-to-digital converter, but also ensures that theanalog-to-digital converter can sample an analog voltage within asampling voltage range of the analog-to-digital converter.

Optionally, the controller may be a bi-directional optical sub-assemblydrive chip.

In this embodiment of the present invention, the controller may be abi-directional optical sub-assembly drive chip in a current ONU. In thisway, hardware costs of the analog-to-digital converter protectioncircuit can be reduced.

Optionally, the analog switch may include, but is not limited to, anyone of an integrated analog switch component, a discrete component, or arelay.

Referring to FIG. 5, FIG. 5 is a schematic structural diagram of acontroller of an analog-to-digital converter protection circuitaccording to an embodiment of the present invention. The controller 500shown in FIG. 5 is the controller in the analog-to-digital converterprotection circuit in FIG. 2. As shown in FIG. 5, the controller 500 ofthe analog-to-digital converter protection circuit may include: at leastone processor 501 such as a CPU, an input port 502, a first output port503, a second output port 504, a memory 505, and at least onecommunications bus 506. The memory 505 may be a high-speed RAM memory,or may be a non-volatile memory (non-volatile memory), for example, atleast one magnetic disk storage. Optionally, the memory 505 may be atleast one storage apparatus far away from the processor 501.

The communications bus 506 is configured to implement connection andcommunication between the components.

The input port 502 is configured to receive a digital voltage outputtedby an analog-to-digital converter.

In this embodiment of the present invention, the digital voltageoutputted by the analog-to-digital converter is a digital voltageobtained by the analog-to-digital converter by performinganalog-to-digital conversion on an analog voltage sampled by aconduction sampling end of an analog switch, and a first sampling endserves as the conduction sampling end to conduct to an output end of theanalog switch.

The memory 505 stores a set of program code, and the processor 501 isconfigured to invoke the program code stored in the memory 505 toperform the following operations: determining whether the digitalvoltage is greater than or equal to a first preset voltage threshold,where the first preset voltage threshold falls within a sampling voltagerange of the analog-to-digital converter; and when the digital voltageis greater than or equal to the first preset voltage threshold,generating a first control signal.

The first output port 503 is configured to output the first controlsignal to the analog switch. The first control signal is used to triggerthe analog switch to switch the conduction sampling end conducted to theoutput end of the analog switch from the first sampling end to a secondsampling end. An analog voltage sampled by the second sampling end isless than an analog voltage sampled by the first sampling end. Aquantity of conduction sampling ends conducted to the output end of theanalog switch is 1, that is, only one sampling end in all sampling endsof the analog switch is conducted to the output end of the analogswitch.

The second output port 504 is configured to: when the processor 501determines that the digital voltage is less than the first presetvoltage threshold, output the digital voltage.

In this embodiment of the present invention, the controller 500controls, according to a relationship between the digital voltagereceived by the input port 502 and the first preset voltage thresholdstored in the controller, the analog switch to switch the conductionsampling end conducted to the output end of analog switch, so that theanalog-to-digital converter can sample an analog voltage within asampling voltage range of the analog-to-digital converter. Therefore, aproblem of damage to the analog-to-digital converter due to that theanalog voltage exceeds the sampling voltage range of theanalog-to-digital converter is avoided.

In an embodiment, the processor 501 is configured to invoke the programcode stored in the memory 505 to further perform the followingoperations: determining whether the digital voltage is greater than asecond preset voltage threshold, where the second preset voltagethreshold is less than the first preset voltage threshold and fallswithin the sampling voltage range; and when the digital voltage is notgreater than (that is, less than or equal to) the second preset voltagethreshold, generating a second control signal.

The second output port 504 is specifically configured to: when thedigital voltage is less than the first preset voltage threshold and thedigital voltage is greater than the second preset voltage threshold,output the digital voltage.

The first output port 503 may be further configured to output the secondcontrol signal to the analog switch. The second control signal is usedto trigger the analog switch to switch the conduction sampling endconducted to the output end of the analog switch from the first samplingend to a third sampling end, and an analog voltage sampled by the thirdsampling end is greater than the analog voltage sampled by the firstsampling end.

As can be seen, when the digital voltage received by the input port 502is less than the first preset voltage threshold and is greater than thesecond preset voltage threshold, the second output port 504 outputs thedigital voltage. When the digital voltage received by the input port 502is less than or equal to the second preset voltage threshold, the firstoutput port 503 outputs a control signal to the analog switch, totrigger the analog switch to control and change the conduction samplingend conducted to the output end of the analog switch. The digitalvoltage outputted by the analog-to-digital converter (that is, thedigital voltage received by the input port 502) is increased by changingthe conduction sampling end conducted to the output end of the analogswitch. This not only ensures that the analog-to-digital converter cansample an analog voltage within a sampling voltage range of theanalog-to-digital converter, but also ensures sampling precision of theanalog-to-digital converter, so that the digital voltage outputted bythe second output port 504 falls within an effective scale.

It should be noted that the first preset voltage threshold and thesecond preset voltage threshold are preset voltage thresholds, which maybe calculated by the controller according to a preset calculation ruleand the sampling voltage range of the analog-to-digital converter, ormay be set by a user according to the user's requirements and thesampling voltage range of the analog-to-digital converter. This is notlimited in this embodiment of the present invention.

In an optional implementation manner, when the analog switch controlsand changes the conduction sampling end conducted to the output end ofthe analog switch, a resistor quantity change between the conductionsampling end conducted to the output end of the analog switch and a tailend of a series circuit is at least 1. This provides a basis forgenerating the control signal to the processor 501.

In an embodiment, an initial conduction sampling end conducted to theoutput end of the analog switch is a sampling end connected to aground-distant end of a tail resistor of the series circuit, and aproduct of a resistance value of the tail resistor of the series circuitand a preset photocurrent threshold falls within the sampling voltagerange. This ensures that the analog-to-digital converter can sample ananalog voltage within a sampling voltage range of the analog-to-digitalconverter.

In an embodiment, a product of a total resistance value of all resistorsin the series circuit and the preset photocurrent threshold is greaterthan or equal to sampling precision of the analog-to-digital converter,and the preset photocurrent threshold is a minimum value of aphotocurrent outputted by a BOSA. This ensures the sampling precision ofthe analog-to-digital converter.

Optionally, the controller 500 may be a bi-directional opticalsub-assembly drive chip.

In this embodiment of the present invention, the controller 500 may be abi-directional optical sub-assembly drive chip in a current ONU. In thisway, hardware costs of the analog-to-digital converter protectioncircuit may be reduced.

Optionally, the analog switch may include, but is not limited to, anyone of an integrated analog switch component, a discrete component, or arelay.

It should be noted that the first sampling end, the second sampling end,the third sampling end that are involved in the foregoing embodiments donot represent the first sampling end, the second sampling end, and thethird sampling end that are obtained after all the sampling ends of theanalog switch are arranged in order, but represent three differentsampling ends.

It should be noted that, in the foregoing embodiments, the descriptionsof the embodiments have respective focuses. For a part that is notdescribed in detail in an embodiment, reference may be made to relateddescriptions in other embodiments. In addition, a person skilled in theart should also appreciate that all the embodiments described in thespecification are exemplary embodiments, and the related actions are notnecessarily mandatory to the present invention.

The steps in the method of the embodiments of the present invention maybe reordered, combined, or omitted according to actual requirements.

A person of ordinary skill in the art may understand that all or a partof the processes of the methods in the embodiments may be implemented bya computer program instructing relevant hardware. The program may bestored in a computer readable storage medium. When the program runs, theprocesses of the methods in the embodiments are performed. The foregoingstorage medium may include: a magnetic disk, an optical disc, aread-only memory (ROM), or a random access memory (RAM).

The analog-to-digital converter protection circuit, the method forcontrolling an analog-to-digital converter protection circuit, and thecontroller that are disclosed in the embodiments of the presentinvention are described above in detail. In this specification, specificexamples are used to describe the principle and implementation mannersof the present invention, and the descriptions of the embodiments areonly intended to help understand the present invention and the core ideaof the present invention. Meanwhile, a person of ordinary skill in theart may, based on the idea of the present invention, make modificationswith respect to the specific implementation manners and the applicationscope. Therefore, the content of this specification shall not beconstrued as a limitation to the present invention.

1-21. (canceled)
 22. An analog-to-digital converter protection circuit,comprising: an analog switch; an analog-to-digital converter; acontroller; and a series circuit; wherein the series circuit comprises aplurality of resistors connected in series; wherein a head end of theseries circuit is configured to be connected to an output end of abi-directional optical sub-assembly (BOSA), a tail end of the seriescircuit is configured to be grounded, a ground-distant end of eachresistor in the series circuit is connected to a different sampling endof the analog switch, an output end of the analog switch is connected toan input end of the analog-to-digital converter, an output end of theanalog-to-digital converter is connected to an input end of thecontroller, and a first output end of the controller is connected to acontrol end of the analog switch; wherein the series circuit isconfigured to convert a photocurrent outputted by the BOSA into ananalog voltage, the different sampling end is configured to sample theanalog voltage outputted by the series circuit, the analog switch isconfigured to output, to the analog-to-digital converter, an analogvoltage sampled by a conduction sampling end of the analog switch, and afirst sampling end serves as the conduction sampling end to conduct tothe output end of the analog switch; wherein the analog-to-digitalconverter is configured to perform analog-to-digital conversion on theanalog voltage sampled by the conduction sampling end to generate adigital voltage, and output the digital voltage to the controller; andwherein the controller is configured to: when the digital voltage isgreater than or equal to a first preset voltage threshold, output afirst control signal to the analog switch, wherein the first controlsignal triggers the analog switch to control a second sampling end toserve as the conduction sampling end to conduct to the output end of theanalog switch, and an analog voltage sampled by the second sampling endis less than an analog voltage sampled by the first sampling end; andwhen the digital voltage is less than the first preset voltagethreshold, control a second output end of the controller to output thedigital voltage, wherein the first preset voltage threshold falls withina sampling voltage range of the analog-to-digital converter.
 23. Theanalog-to-digital converter protection circuit according to claim 22,wherein when the digital voltage is less than the first preset voltagethreshold, the controller controlling a second output end of thecontroller to output the digital voltage comprises: when the digitalvoltage is less than the first preset voltage threshold and the digitalvoltage is greater than a second preset voltage threshold, controllingthe second output end of the controller to output the digital voltage,wherein the second preset voltage threshold falls within the samplingvoltage range; and wherein the controller is further configured to, whenthe digital voltage is less than or equal to the second preset voltagethreshold, output a second control signal to the analog switch, whereinthe second control signal is used to trigger the analog switch tocontrol a third sampling end to serve as the conduction sampling end toconduct to the output end of the analog switch, and an analog voltagesampled by the third sampling end is greater than the analog voltagesampled by the first sampling end.
 24. The analog-to-digital converterprotection circuit according to claim 22, wherein when the analog switchchanges the conduction sampling end conducted to the output end of theanalog switch, a resistor quantity change between the conductionsampling end conducted to the output end of the analog switch and thetail end of the series circuit is at least
 1. 25. The analog-to-digitalconverter protection circuit according to claim 22, wherein an initialconduction sampling end conducted to the output end of the analog switchis a sampling end connected to a ground-distant end of a tail resistorof the series circuit; and wherein a product of a resistance value ofthe tail resistor of the series circuit and a preset photocurrentthreshold falls within the sampling voltage range.
 26. Theanalog-to-digital converter protection circuit according to claim 22,wherein a product of a total resistance value of all resistors in theseries circuit and a preset photocurrent threshold is greater than orequal to sampling precision of the analog-to-digital converter.
 27. Theanalog-to-digital converter protection circuit according to claim 22,wherein the controller is a bi-directional optical sub-assembly drivechip.
 28. The analog-to-digital converter protection circuit accordingto claim 22 wherein the analog switch comprises an integrated analogswitch component, a discrete component, or a relay.
 29. A method,comprising: receiving, by a controller, a digital voltage outputted byan analog-to-digital converter, wherein an analog-to-digital converterprotection circuit comprises an analog switch, the analog-to-digitalconverter, the controller, and a series circuit, the series circuitcomprises a plurality of resistors connected in series, a head end ofthe series circuit is configured to be connected to an output end of abi-directional optical sub-assembly (BOSA), a tail end of the seriescircuit is configured to be grounded, a ground-distant end of eachresistor in the series circuit is connected to a different sampling endof the analog switch, an output end of the analog switch is connected toan input end of the analog-to-digital converter, an output end of theanalog-to-digital converter is connected to an input end of thecontroller, a first output end of the controller is connected to acontrol end of the analog switch, and wherein the digital voltage is adigital voltage obtained by the analog-to-digital converter byperforming analog-to-digital conversion on an analog voltage sampled bya conduction sampling end of the analog switch, and a first sampling endserves as the conduction sampling end to conduct to the output end ofthe analog switch; when the digital voltage is greater than or equal toa first preset voltage threshold, outputting, by the controller, a firstcontrol signal to the analog switch, wherein the first control signaltriggers the analog switch to control a second sampling end to serve asthe conduction sampling end to conduct to the output end of the analogswitch, an analog voltage sampled by the second sampling end is lessthan an analog voltage sampled by the first sampling end, and the firstpreset voltage threshold falls within a sampling voltage range of theanalog-to-digital converter; and when the digital voltage is less thanthe first preset voltage threshold, controlling, by the controller, asecond output end of the controller to output the digital voltage. 30.The method according to claim 29, wherein when the digital voltage isless than the first preset voltage threshold, controlling the secondoutput end of the controller to output the digital voltage comprises:when the digital voltage is less than the first preset voltage thresholdand the digital voltage is greater than a second preset voltagethreshold, controlling, by the controller, the second output end of thecontroller to output the digital voltage, wherein the second presetvoltage threshold falls within the sampling voltage range; and whereinthe method further comprises: when the digital voltage is less than orequal to the second preset voltage threshold, outputting, by thecontroller, a second control signal to the analog switch, wherein thesecond control signal triggers the analog switch to control a thirdsampling end to serve as the conduction sampling end to conduct to theoutput end of the analog switch, and an analog voltage sampled by thethird sampling end is greater than the analog voltage sampled by thefirst sampling end.
 31. The method according to claim 29, wherein whenthe analog switch controls and changes the conduction sampling endconducted to the output end of the analog switch, a resistor quantitychange between the conduction sampling end conducted to the output endof the analog switch and the tail end of the series circuit is atleast
 1. 32. The method according to claim 29, wherein an initialconduction sampling end conducted to the output end of the analog switchis a sampling end connected to a ground- distant end of a tail resistorof the series circuit; and wherein a product of a resistance value ofthe tail resistor of the series circuit and a preset photocurrentthreshold falls within the sampling voltage range.
 33. The methodaccording to claim 29, wherein a product of a total resistance value ofall resistors in the series circuit and a preset photocurrent thresholdis greater than or equal to sampling precision of the analog-to-digitalconverter.
 34. The method according to claim 29, wherein the controlleris a bi-directional optical sub-assembly drive chip.
 35. The methodaccording to claim 29, wherein the analog switch comprises an integratedanalog switch component, a discrete component, or a relay.
 36. Acontroller of an analog-to-digital converter protection circuit,comprising: a processor; a memory; an input port; a first output port;and a second output port; wherein the analog-to-digital converterprotection circuit comprises an analog switch, an analog-to-digitalconverter, the controller, and a series circuit, the series circuitcomprises at least two resistors connected in series, a head end of theseries circuit is configured to be connected to an output end of abi-directional optical sub-assembly (BOSA), a tail end of the seriescircuit is configured to be grounded, a ground-distant end of eachresistor in the series circuit is connected to a different sampling endof the analog switch, an output end of the analog switch is connected toan input end of the analog-to-digital converter, an output end of theanalog-to-digital converter is connected to the input port, and thefirst output port is connected to a control end of the analog switch;wherein the input port is configured to receive a digital voltageoutputted by the analog- to-digital converter, wherein the digitalvoltage is a digital voltage obtained by the analog-to- digitalconverter by performing analog-to-digital conversion on an analogvoltage sampled by a conduction sampling end of the analog switch, and afirst sampling end serves as the conduction sampling end to conduct tothe output end of the analog switch; wherein the memory stores a set ofprogram code, and the processor is configured to invoke the program codestored in the memory to determine whether the digital voltage is greaterthan or equal to a first preset voltage threshold, wherein the firstpreset voltage threshold falls within a sampling voltage range of theanalog-to-digital converter; wherein the first output port is configuredto, when the digital voltage is greater than or equal to the firstpreset voltage threshold, output a first control signal to the analogswitch, wherein the first control signal is used to trigger the analogswitch to control a second sampling end to serve as the conductionsampling end to conduct to the output end of the analog switch, and ananalog voltage sampled by the second sampling end is less than an analogvoltage sampled by the first sampling end; and wherein the second outputport is configured to, when the digital voltage is less than the firstpreset voltage threshold, output the digital voltage.
 37. The controlleraccording to claim 36, wherein the processor is further configured toinvoke the program code stored in the memory to determine whether thedigital voltage is greater than a second preset voltage threshold,wherein the second preset voltage threshold falls within the samplingvoltage range; wherein the second output port is configured to, when thedigital voltage is less than the first preset voltage threshold and thedigital voltage is greater than the second preset voltage threshold,output the digital voltage; and wherein the first output port is furtherconfigured to, when the digital voltage is less than or equal to thesecond preset voltage threshold, output a second control signal to theanalog switch, wherein the second control signal triggers the analogswitch to control a third sampling end to serve as the conductionsampling end to conduct to the output end of the analog switch, and ananalog voltage sampled by the third sampling end is greater than theanalog voltage sampled by the first sampling end.
 38. The controlleraccording to claim 36, wherein when the analog switch controls andchanges the conduction sampling end conducted to the output end of theanalog switch, a resistor quantity change between the conductionsampling end conducted to the output end of the analog switch and thetail end of the series circuit is at least
 1. 39. The controlleraccording to claim 36, wherein an initial conduction sampling endconducted to the output end of the analog switch is a sampling endconnected to a ground- distant end of a tail resistor of the seriescircuit; and wherein a product of a resistance value of the tailresistor of the series circuit and a preset photocurrent threshold fallswithin the sampling voltage range.
 40. The controller according to claim36, wherein a product of a total resistance value of all resistors inthe series circuit and a preset photocurrent threshold is greater thanor equal to sampling precision of the analog-to-digital converter. 41.The controller according to claim 36, wherein the controller is abi-directional optical sub-assembly drive chip.